/**
 * 
 */
package edu.westga.musicrecommender.gui;

import java.awt.*;
import java.awt.event.*;

import javax.swing.*;
/**
 * @author Adam, Matthew, Crystal
 * This class creates the GUI for the music recommender and controls the behavior of
 * the program when the user selects anything on the GUI.  The lists for the music
 * genres will also be made in methods that will be called in an action listener.
 * @param <RapListener>
 *
 */
public class MusicRecommenderGui {

	private JFrame frame;
	private JTextArea text;
	private JMenuBar mainMenuBar;	
	private JMenu fileMenu;
	private JMenu helpMenu;
	private JCheckBox rap;
	private JCheckBox randb;
	private JCheckBox country;
	private JCheckBox pop;
	private JCheckBox rock;
	private JScrollPane scrollPane;	
	private JPanel panel;
	private JPanel panel1;
	
	
	//constructor for the music recommender GUI
	public MusicRecommenderGui() {
		show();
	}
	
	//allows the recommender to be seen
	public void show() {
		
		frame = new JFrame("Music Reccomender");
		text = new JTextArea(20,30);
		scrollPane = new JScrollPane(text);
		rap = new JCheckBox("Rap",false);
		randb = new JCheckBox("R&B",false);
		country = new JCheckBox("Country",false);
		pop = new JCheckBox("Pop",false);
		rock = new JCheckBox("Rock",false);
		//--------------------------------------------
		rap.addActionListener(new RapListener());
		randb.addActionListener(new RBListener());
		country.addActionListener(new CountryListener());
		pop.addActionListener(new PopListener());
		rock.addActionListener(new RockListener());
		//----------------------------------------------
		frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		
		panel = new JPanel();
		panel.setLayout(new BoxLayout(panel, BoxLayout.LINE_AXIS));
		
		panel.add(rap);
		panel.add(randb);
		panel.add(country);
		panel.add(pop);
		panel.add(rock);
		
		panel1 = new JPanel();
		panel1.add(scrollPane, BorderLayout.CENTER);

		frame.add(panel,BorderLayout.NORTH);
		frame.add(panel1,BorderLayout.SOUTH);
		frame.pack();
		frame.setVisible(true);
		addButtonPanel();
		buildMainMenuBar();
	}
	
	private void addButtonPanel() {
		JPanel buttonPanel = new JPanel();
		buttonPanel.setLayout(new BoxLayout(buttonPanel, BoxLayout.LINE_AXIS));
		JButton clearButton = new JButton("Clear my selections");
		buttonPanel.add(clearButton);
		clearButton.addActionListener(new clearListener());
		this.frame.add(buttonPanel, BorderLayout.SOUTH);
		
	}
	
	// Creates the main menu bar
	private void buildMainMenuBar() {
		this.mainMenuBar = new JMenuBar();
		this.frame.setJMenuBar(this.mainMenuBar);
		this.buildFileMenu();
		this.mainMenuBar.add(fileMenu);
		this.buildHelpMenu();
		this.mainMenuBar.add(helpMenu);
	}
	
	// Creates the file menu and adds menu items to it.
	private void buildFileMenu() {
		fileMenu = new JMenu("File");
		fileMenu.setMnemonic(KeyEvent.VK_F);
		
		addQuitMenuItem();				
	}
	
	//creates the help menu and adds items to it
	private void buildHelpMenu() {
		helpMenu = new JMenu("Help");
		helpMenu.setMnemonic(KeyEvent.VK_H);
	}

	// Sets up the menu item to exit the program.
	private void addQuitMenuItem() {
		JMenuItem quitItem = new JMenuItem("Quit");
		quitItem.setAccelerator(KeyStroke.getKeyStroke("ctrl Q"));
		quitItem.setMnemonic(KeyEvent.VK_Q);
		quitItem.addActionListener(new QuitListener());		
		fileMenu.add(quitItem);
	}
	
//----------------------------------Methods for each genre of music-------------------------------------------//
	public String rap(){
		
		String rapSongs = "---------------------Rap Songs---------------------------" + '\n'+ "Jay Z - Run This Town" + '\n' + "Drake - Forever" + '\n'+ 
		"Kanye West - Flashing Lights" + '\n' + "Ludacris - Diamond In The Back" + 
		'\n' + "T.I. - Hotel" + '\n' + "Plies - Miss Becky" + '\n' + "Twista - Wetter" + '\n'+ 
		"Rick Ross - Mayback Music" + '\n' + "Young Jeezy - Vacation" + '\n' + "Young Joc - Hustle"
		+ '\n' + "Young Dro - Day One" + '\n' +
		"---------------------Rap Songs---------------------------" + '\n'; 
	
		return rapSongs;
			
	}
	
	public String rb(){
		
		String rbSongs = "---------------------R&B Songs---------------------------" + 
		'\n'+ "Monica - Still Standing" + '\n' + "T Pain - Studio Luv" + '\n'+ "Neyo - Got Her Own" + '\n'+
		"Jamie Foxx - Blame It" + '\n' + "Trey Songz - Ready" + '\n'+ "Alicia Keys - No One" + '\n'+
		"Maxwell - Pretty Wings" + '\n' + "Pleasure P - Boyfriend #2" + '\n'+ "Jagged Edge - Good Luck Charm" + '\n' +
		'\n' + "The Dream - Love and Hate" + '\n' +
		"---------------------R&B Songs---------------------------" + '\n'; 
	
		return rbSongs;			
	}
	
	public String country(){
		
		String countrySongs = "---------------------Country Songs---------------------------" + '\n'+ "Lookin For A Good Time - Lady Antebellum" + '\n' + "You Belong With Me - Taylor Swift" + 
		'\n'+ "Just A Dream, Carrie Underwood" + '\n'+ "I'm Movin On, Rascal Flatts" + '\n' 
		+ "Amazed - Lonestar" + '\n'+ "Because Of You - Reba & Kelly Clarkson" + '\n'+
		"Boondocks - Little Big Town" + '\n' + "It's Your Love - Tim McGraw & Faith Hill" +
		'\n'+ "Strawberry Wine - Deanna Carter" + '\n' + "Best Days Of Your Life, Kelli Pickler" + '\n'+ 
		"---------------------Country Songs---------------------------" + '\n'; 
	
		return countrySongs;			
	}
	
	public String pop(){
		
		String popSongs = "---------------------Pop Songs---------------------------"+ '\n'+"Black Eyed Peas - Boom Boom Pow" + '\n' + "Beyonce - Halo" + '\n'+ "Lady GaGa - Poker Face" + '\n' +
		"3OH!3 - Don't Trust Me" + '\n' + "Lily Allen - The Fear" + '\n'+ "Jordin Sparks - Battlefield" + '\n' +
		"The Ting Tings - That's Not My Name" + '\n' + "Katy Perry - Waking Up In Vegas" + 
		'\n'+ "The Script - The Man Who Can't Be Moved" + '\n' + "Kelly Clarkson - My Life Would Suck Without You" + '\n' +
		 "---------------------Pop Songs---------------------------" + '\n'; 
	
		return popSongs;			
	}
	
	public String rock(){
		
		String rockSongs = "---------------------Rock Songs---------------------------" + '\n'+"Hell's Bells - AC/DC" + '\n' + "Welcome To The Jungle - Guns N' Roses" + '\n'+ "Livin' on a Prayer - Bon jovi" + 
		'\n' + "Seperate Ways - Journey" + '\n' + "Black Dog - Led Zeppelin" + '\n'+ "Get A Grip - Aerosmith" + '\n' +
		"Poison - Alice Cooper" + '\n' + "Pour Some Sugar on Me - Def Leppard" + '\n'+ "Hot For Teacher - Van Halen" 
		+ '\n' + "Tie your mother Down - Queen" + '\n' + "---------------------Rock Songs---------------------------" + '\n'; 
	
		return rockSongs;			
	}
//-----------------------Action Listeners------------------------------------------//
//In Order for the removals to work properly, you must uncheck the box from in the order
//they are listed in the the if-statement from right to left. I don't know why...
public class RBListener implements ActionListener{
	@Override
	public void actionPerformed(ActionEvent arg0) {
		if(randb.isSelected()==true){
			text.append(rb());
			System.out.println("Show R&B on");
		}
		else if(rap.isSelected()== false && randb.isSelected()==false 
				&& country.isSelected()==false
				&& rock.isSelected()==false && pop.isSelected()==false){
			String all = null;
			text.setText(all);
			
			System.out.println("Show Nothing");
			}
		//1
		else if (randb.isSelected()==false && rap.isSelected()==true 
				&& country.isSelected()==true
				&& rock.isSelected()==true && pop.isSelected()==true){
			String all = rap() + rock() + country() + pop();
			text.setText(all);
			
			System.out.println("R&B off");
		}
		//2
		else if (randb.isSelected()==false && rap.isSelected()==false 
				& country.isSelected()==true
				&& rock.isSelected()==true && pop.isSelected()==true){
			
			String all = rock() + country() + pop();
			text.setText(all);
			
			System.out.println("Country & Pop & Rock");	
		}
		//3
		else if (randb.isSelected()==false && pop.isSelected()==false& 
				rap.isSelected()==true && country.isSelected()==true
				&& rock.isSelected()==true){
			
			String all = country() + rock() + rap();
			text.setText(all);
			
			System.out.println("Show Country & Rock & Rap");	
		}
		//4
		else if (randb.isSelected()==false && rap.isSelected()==true
				& country.isSelected()==false && rock.isSelected()==true 
				&& pop.isSelected()==true){
			
			String all = rock() + rap() + pop();
			text.setText(all);
			
			System.out.println("Show Rock + Rap + Pop");	
		}
		//5
		else if (randb.isSelected()==false && rap.isSelected()==true
				& country.isSelected()==true && rock.isSelected()==false 
				&& pop.isSelected()==true){
			
			String all = rap() + country() + pop();
			text.setText(all);
			
			System.out.println("Show Rap & Country & Pop");	
		}
		//-------------------------------3F's------------------------------------
		//6
		else if (randb.isSelected()==false && rap.isSelected()==false
				& country.isSelected()==true && rock.isSelected()==true 
				&& pop.isSelected()==false){
			
			String all = country() + rock();
			text.setText(all);
			
			System.out.println("Show Country & Rock");	
		}
		//7
		else if (randb.isSelected()==false && rap.isSelected()==false
				& country.isSelected()==false && rock.isSelected()==true 
				&& pop.isSelected()==true){
			
			String all = pop() + rock();
			text.setText(all);
			
			System.out.println("Show Pop & Rock");	
		}
		//8
		else if (randb.isSelected()==false && rap.isSelected()==false
				& country.isSelected()==true && rock.isSelected()==false 
				&& pop.isSelected()==true){
			
			String all = country() + pop();
			text.setText(all);
			
			System.out.println("Show Country & Pop");	
		}
		//9
		else if (randb.isSelected()==false && rap.isSelected()==true
				& country.isSelected()==false && rock.isSelected()==true 
				&& pop.isSelected()==false){
			
			String all = rap() + rock();
			text.setText(all);
			
			System.out.println("Show Rap & Rock");	
		}
		//10
		else if (randb.isSelected()==false && rap.isSelected()==true
				& country.isSelected()==false && rock.isSelected()==false 
				&& pop.isSelected()==true){
			
			String all = rap() + pop();
			text.setText(all);
			
			System.out.println("Show Rap & Pop");	
		}
		//11
		else if (randb.isSelected()==false && rap.isSelected()==true
				& country.isSelected()==true && rock.isSelected()==false 
				&& pop.isSelected()==false){
			
			String all = rap() + country();
			text.setText(all);
			
			System.out.println("Show Rap & Country");	
		}
		//----------------------4 F's-----------------------------------
		//12
		else if (randb.isSelected()==false && rap.isSelected()==false
				& country.isSelected()==false && rock.isSelected()==true 
				&& pop.isSelected()==false){
			
			String all = rock();
			text.setText(all);
			
			System.out.println("Show Rock");	
		}
		//13
		else if (randb.isSelected()==false && rap.isSelected()==false
				& country.isSelected()==true && rock.isSelected()==false 
				&& pop.isSelected()==false){
			
			String all = country();
			text.setText(all);
			
			System.out.println("Show Country");	
		}
		//14
		else if (randb.isSelected()==false && rap.isSelected()==true
				& country.isSelected()==false && rock.isSelected()==false 
				&& pop.isSelected()==false){
			
			String all = rap();
			text.setText(all);
			
			System.out.println("Show Rap");	
		}
		//15
		else if (randb.isSelected()==false && rap.isSelected()==false
				& country.isSelected()==false && rock.isSelected()==false 
				&& pop.isSelected()==true){
			
			String all = rock();
			text.setText(all);
			
			System.out.println("Show Pop");	
		}
		
	}
}

	public class  RapListener implements ActionListener{
		
	@Override
	public void actionPerformed(ActionEvent arg0) {
		if(rap.isSelected()== true){
			text.append(rap());
			System.out.println("Rap on");
			}
		//1-15
		else if(rap.isSelected()== false && randb.isSelected()==true 
				&& country.isSelected()==true
				&& rock.isSelected()==true && pop.isSelected()==true){
			String all = rb() + rock() + country() + pop();
			text.setText(all);
			
			System.out.println("Rap off");
			}
		else if(rap.isSelected()== false && randb.isSelected()==false 
				&& country.isSelected()==false
				&& rock.isSelected()==false && pop.isSelected()==false){
			String all = null;
			text.setText(all);
			
			System.out.println("Show Nothing");
			}
		//1
		else if (rap.isSelected()== false && randb.isSelected()==false 
				&& country.isSelected()==true
				&& rock.isSelected()==true && pop.isSelected()==true){
			
			String all = rock() + country() + pop();
			text.setText(all);
			
			System.out.println("Show Rock & Country & Pop");	
		}
		//2
		else if (rap.isSelected()== false && randb.isSelected()==true 
				&& country.isSelected()==false
				&& rock.isSelected()==true && pop.isSelected()==true){
			
			String all = rock() + rb() + pop();
			text.setText(all);
			
			System.out.println("Show Rock & R&B & Pop");	
		}
		//3
		else if (rap.isSelected()== false && randb.isSelected()==true 
				&& country.isSelected()==true
				&& rock.isSelected()==false && pop.isSelected()==true){
			
			String all = rb() + country() + pop();
			text.setText(all);
			
			System.out.println("Show R&B & Country & Pop");	
		}
		//4
		else if (rap.isSelected()== false && randb.isSelected()==true 
				&& country.isSelected()==true
				&& rock.isSelected()==true && pop.isSelected()==false){
			
			String all = rb() + country() + rock();
			text.setText(all);
			
			System.out.println("Show R&B & Country & Rock");	
		}
		////////////////////////////3 F's///////////////////////////////////
		//5
		else if (rap.isSelected()== false && randb.isSelected()==false 
				&& country.isSelected()==false
				&& rock.isSelected()==true && pop.isSelected()==true){
			
			String all = rock() + pop();
			text.setText(all);
			
			System.out.println("Show Rock & Pop");	
		}
		//6
		else if (rap.isSelected()== false && randb.isSelected()==false 
				&& country.isSelected()==true
				&& rock.isSelected()==false && pop.isSelected()==true){
			
			String all = country() + pop();
			text.setText(all);
			
			System.out.println("Show Country & Pop");	
		}
		//7
		else if (rap.isSelected()== false && randb.isSelected()==false 
				&& country.isSelected()==true
				&& rock.isSelected()==true && pop.isSelected()==false){
			
			String all = country() + rock();
			text.setText(all);
			
			System.out.println("Show Country & Rock");	
		}
		//8
		else if (rap.isSelected()== false && randb.isSelected()==true 
				&& country.isSelected()==false
				&& rock.isSelected()==false && pop.isSelected()==true){
			
			String all = rb() + pop();
			text.setText(all);
			
			System.out.println("Show R&B & Pop");	
		}
		//9
		else if (rap.isSelected()== false && randb.isSelected()==true 
				&& country.isSelected()==false
				&& rock.isSelected()==true && pop.isSelected()==false){
			
			String all = rb() + rock();
			text.setText(all);
			
			System.out.println("Show R&B & Rock");	
		}
		//10
		else if (rap.isSelected()== false && randb.isSelected()==true 
				&& country.isSelected()==true
				&& rock.isSelected()==false && pop.isSelected()==false){
			
			String all = rb() + country();
			text.setText(all);
			
			System.out.println("Show R&B & Country");	
		}
		//-----------------4 F's----------------------------------------------
		//11
		else if (rap.isSelected()== false && randb.isSelected()==false 
				&& country.isSelected()==false
				&& rock.isSelected()==false && pop.isSelected()==true){
			
			String all = pop();
			text.setText(all);
			
			System.out.println("Show Pop");	
		}
		//12
		else if (rap.isSelected()== false && randb.isSelected()==false 
				&& country.isSelected()==false
				&& rock.isSelected()==true && pop.isSelected()==false){
			
			String all = rock();
			text.setText(all);
			
			System.out.println("Show Rock");	
		}
		//13
		else if (rap.isSelected()== false && randb.isSelected()==false 
				&& country.isSelected()==true
				&& rock.isSelected()==false && pop.isSelected()==false){
			
			String all = country();
			text.setText(all);
			
			System.out.println("Show Country");	
		}
		//14
		else if (rap.isSelected()== false && randb.isSelected()==true 
				&& country.isSelected()==false
				&& rock.isSelected()==false && pop.isSelected()==false){
			
			String all = rb();
			text.setText(all);
			
			System.out.println("Show R&B");	
		}		
		
	}
	
}
	public class  CountryListener implements ActionListener{
		@Override
		public void actionPerformed(ActionEvent arg0) {
			if(country.isSelected()== true){
				text.append(country());
				System.out.println("country on");
				}
			else if(rap.isSelected()== false && randb.isSelected()==false 
					&& country.isSelected()==false
					&& rock.isSelected()==false && pop.isSelected()==false){
				String all = null;
				text.setText(all);
				
				System.out.println("Show Nothing");
				}
			else if(country.isSelected()== false && randb.isSelected()==true 
					&& pop.isSelected()==true
					&& rap.isSelected()==true && rock.isSelected()==true){
				String all = rap() + rock() + pop() + rb();
				text.setText(all);
				System.out.println("Country off");
			}
			//2
			else if (country.isSelected()== false && randb.isSelected()==true 
					&& pop.isSelected()==true
					&& rap.isSelected()==true && rock.isSelected()==false){
				
				String all = rb() + rap() + pop();
				text.setText(all);
				
				System.out.println("Show R&B & Rap & Pop");	
			}
			//3
			else if (country.isSelected()== false && randb.isSelected()==true 
					&& pop.isSelected()==false
					&& rap.isSelected()==true && rock.isSelected()==true){
				
				String all = rock() + rap() + rb();
				text.setText(all);
				
				System.out.println("Show Rock & Rap & R&B");	
			}
			//4
			else if (country.isSelected()== false && randb.isSelected()==true 
					&& pop.isSelected()==true
					&& rap.isSelected()==false && rock.isSelected()==true){
				
				String all = rb() + rock() + pop();
				text.setText(all);
				
				System.out.println("Show R&B & Pop & Rock");	
			}
			//5
			else if (country.isSelected()== false && randb.isSelected()==false 
					&& pop.isSelected()==true
					&& rap.isSelected()==true && rock.isSelected()==true){
				
				String all = pop() + rock() + rap();
				text.setText(all);
				
				System.out.println("Show Pop & Rock & Rap");	
			}
			//-------------3 F's-----------------------------------------
			//6
			else if (country.isSelected()== false && randb.isSelected()==true 
					&& pop.isSelected()==false
					&& rap.isSelected()==true && rock.isSelected()==false){
				
				String all = rap() + rb();
				text.setText(all);
				
				System.out.println("Show Rap & R&B");	
			}
			//7
			else if (country.isSelected()== false && randb.isSelected()==true 
					&& pop.isSelected()==true
					&& rap.isSelected()==false && rock.isSelected()==false){
				
				String all = pop() + rb();
				text.setText(all);
				
				System.out.println("Show Pop & R&B");	
			}
			//8
			else if (country.isSelected()== false && randb.isSelected()==false 
					&& pop.isSelected()==true
					&& rap.isSelected()==true && rock.isSelected()==false){
				
				String all = rap() + pop();
				text.setText(all);
				
				System.out.println("Show Rap & Pop");	
			}
			//9
			else if (country.isSelected()== false && randb.isSelected()==true 
					&& pop.isSelected()==false
					&& rap.isSelected()==false && rock.isSelected()==true){
				
				String all = rb() + rock();
				text.setText(all);
				
				System.out.println("Show R&B & Rock");	
			}
			//10
			else if (country.isSelected()== false && randb.isSelected()==false 
					&& pop.isSelected()==true
					&& rap.isSelected()==false && rock.isSelected()==true){
				
				String all = rock() + pop();
				text.setText(all);
				
				System.out.println("Show Rock & Pop");	
			}
			//11
			else if (country.isSelected()== false && randb.isSelected()==false 
					&& pop.isSelected()==false
					&& rap.isSelected()==true && rock.isSelected()==true){
				
				String all = rap() + rock();
				text.setText(all);
				
				System.out.println("Show Rap & Rock");	
			}
			//---------------4 F's-----------------------------------
			//12
			else if (country.isSelected()== false && randb.isSelected()==true 
					&& pop.isSelected()==false
					&& rap.isSelected()==false && rock.isSelected()==false){
				
				String all = rb();
				text.setText(all);
				
				System.out.println("Show R&B");	
			}
			//13
			else if (country.isSelected()== false && randb.isSelected()==false 
					&& pop.isSelected()==false
					&& rap.isSelected()==true && rock.isSelected()==false){
				
				String all = rap();
				text.setText(all);
				
				System.out.println("Show Rap");	
			}
			//14
			else if (country.isSelected()== false && randb.isSelected()==false 
					&& pop.isSelected()==true
					&& rap.isSelected()==false && rock.isSelected()==false){
				
				String all = pop();
				text.setText(all);
				
				System.out.println("Show Pop");	
			}
			//15
			else if (country.isSelected()== false && randb.isSelected()==false 
					&& pop.isSelected()==false
					&& rap.isSelected()==false && rock.isSelected()==true){
				
				String all = rock();
				text.setText(all);
				
				System.out.println("Show Rock");	
			}
		}
	}
		public class  PopListener implements ActionListener{	
			@Override
			public void actionPerformed(ActionEvent arg0) {
				if(pop.isSelected()== true){
					text.append(pop());
					System.out.println("Pop on");
					}
				else if(rap.isSelected()== false && randb.isSelected()==false 
						&& country.isSelected()==false
						&& rock.isSelected()==false && pop.isSelected()==false){
					String all = null;
					text.setText(all);
					
					System.out.println("Show Nothing");
					}
				else if(pop.isSelected()== false && randb.isSelected()==true 
						&& country.isSelected()==true
						&& rap.isSelected()==true && rock.isSelected()==true){
					String all = rap() + rock() + country() + rb();
					text.setText(all);
					System.out.println("Pop off");
				}
				//2
				else if (pop.isSelected()== false && randb.isSelected()==true 
						&& country.isSelected()==true
						&& rap.isSelected()==false && rock.isSelected()==true){
					
					String all = rb() + country() + rock();
					text.setText(all);
					
					System.out.println("Show R&B & Country & Rock");	
				}
				//3
				else if (pop.isSelected()== false && randb.isSelected()==true 
						&& country.isSelected()==true
						&& rap.isSelected()==false && rock.isSelected()==true){
					
					String all = rock() + rb() + country();
					text.setText(all);
					
					System.out.println("Show Rock & R&B & Country");	
				}
				//4
				else if (pop.isSelected()== false && randb.isSelected()==false 
						&& country.isSelected()==true
						&& rap.isSelected()==true && rock.isSelected()==true){
					
					String all = country() + rap() + rock();
					text.setText(all);
					
					System.out.println("Show Country & Rap & Rock");	
				}
				//5
				else if (pop.isSelected()== false && randb.isSelected()==true 
						&& country.isSelected()==false
						&& rap.isSelected()==true && rock.isSelected()==true){
					
					String all = rb() + rap() + rock();
					text.setText(all);
					
					System.out.println("Show R&B & Rap & Rock");	
				}
				//-------------------3 F's---------------------------------
				//6
				else if (pop.isSelected()== false && randb.isSelected()==true 
						&& country.isSelected()==true
						&& rap.isSelected()==false && rock.isSelected()==false){
					
					String all = country() + rb();
					text.setText(all);
					
					System.out.println("Show Country & R&B");	
				}
				//7
				else if (pop.isSelected()== false && randb.isSelected()==false 
						&& country.isSelected()==true
						&& rap.isSelected()==true && rock.isSelected()==false){
					
					String all = country() + rap();
					text.setText(all);
					
					System.out.println("Show Country & Rap");	
				}
				//8
				else if (pop.isSelected()== false && randb.isSelected()==true 
						&& country.isSelected()==false
						&& rap.isSelected()==true && rock.isSelected()==false){
					
					String all = rb() + rap();
					text.setText(all);
					
					System.out.println("Show R&B & Rap");	
				}
				//9
				else if (pop.isSelected()== false && randb.isSelected()==false 
						&& country.isSelected()==true
						&& rap.isSelected()==false && rock.isSelected()==true){
					
					String all = rock() + country();
					text.setText(all);
					
					System.out.println("Show Rock & Country");	
				}
				//10
				else if (pop.isSelected()== false && randb.isSelected()==true 
						&& country.isSelected()==false
						&& rap.isSelected()==false && rock.isSelected()==true){
					
					String all = rb() + rock();
					text.setText(all);
					
					System.out.println("Show R&B & Rock");	
				}
				//11
				else if (pop.isSelected()== false && randb.isSelected()==false 
						&& country.isSelected()==false
						&& rap.isSelected()==true && rock.isSelected()==true){
					
					String all = rock() + rap();
					text.setText(all);
					
					System.out.println("Show Rock & Rap");	
				}
				//---------------4 F's-------------------------------------------
				//12
				else if (pop.isSelected()== false && randb.isSelected()==false 
						&& country.isSelected()==true
						&& rap.isSelected()==false && rock.isSelected()==false){
					
					String all = country();
					text.setText(all);
					
					System.out.println("Show Country");	
				}
				//13
				else if (pop.isSelected()== false && randb.isSelected()==true 
						&& country.isSelected()==false
						&& rap.isSelected()==false && rock.isSelected()==false){
					
					String all = rb();
					text.setText(all);
					
					System.out.println("Show R&B");	
				}
				//14
				else if (pop.isSelected()== false && randb.isSelected()==false 
						&& country.isSelected()==false
						&& rap.isSelected()==true && rock.isSelected()==false){
					
					String all = rap();
					text.setText(all);
					
					System.out.println("Show Rap");	
				}
				//15
				else if (pop.isSelected()== false && randb.isSelected()==false 
						&& country.isSelected()==false
						&& rap.isSelected()==false && rock.isSelected()==true){
					
					String all = rock();
					text.setText(all);
					
					System.out.println("Show Rock");	
				}
			}
		}
			public class  RockListener implements ActionListener{
				@Override
				public void actionPerformed(ActionEvent arg0) {
					if(rock.isSelected()== true){
						text.append(rock());
						System.out.println("rock on");
						}
					else if(rap.isSelected()== false && randb.isSelected()==false 
							&& country.isSelected()==false
							&& rock.isSelected()==false && pop.isSelected()==false){
						String all = null;
						text.setText(all);
						
						System.out.println("Show Nothing");
						}
					else if(rock.isSelected()== false && randb.isSelected()==true 
							&& country.isSelected()==true
							&& rap.isSelected()==true && pop.isSelected()==true){
						String all = rap() + pop() + country() + rb();
						text.setText(all);
						System.out.println("Rock off");
					}
					//1
					else if (rock.isSelected()== false && randb.isSelected()==true 
							&& country.isSelected()==true
							&& rap.isSelected()==false && pop.isSelected()==true){
						
						String all = rb() + country() + pop();
						text.setText(all);
						
						System.out.println("Show R&B & Country & Pop");	
					}
					//2
					else if (rock.isSelected()== false && randb.isSelected()==true 
							&& country.isSelected()==true
							&& rap.isSelected()==true && pop.isSelected()==false){
						
						String all = rap() + country() + rb();
						text.setText(all);
						
						System.out.println("Show Rock & Country & R&B");	
					}
					//3
					else if (rock.isSelected()== false && randb.isSelected()==true 
							&& country.isSelected()==false
							&& rap.isSelected()==true && pop.isSelected()==true){
						
						String all = rb() + rap() + pop();
						text.setText(all);
						
						System.out.println("Show R&B & Rap & Pop");	
					}
					//4
					else if (rock.isSelected()== false && randb.isSelected()==false 
							&& country.isSelected()==true
							&& rap.isSelected()==true && pop.isSelected()==true){
						
						String all = pop() + country() + rap();
						text.setText(all);
						
						System.out.println("Show Pop & Country & Rap");	
					}
					//-----------------------3 F's-----------------------------
					//5
					else if (rock.isSelected()== false && randb.isSelected()==true 
							&& country.isSelected()==true
							&& rap.isSelected()==false && pop.isSelected()==false){
						
						String all = rb() + country();
						text.setText(all);
						
						System.out.println("Show R&B & Country");	
					}
					//6
					else if (rock.isSelected()== false && randb.isSelected()==true 
							&& country.isSelected()==false
							&& rap.isSelected()==false && pop.isSelected()==true){
						
						String all = pop() + rb();
						text.setText(all);
						
						System.out.println("Show Pop & R&B");	
					}
					//7
					else if (rock.isSelected()== false && randb.isSelected()==false 
							&& country.isSelected()==true
							&& rap.isSelected()==false && pop.isSelected()==true){
						
						String all = pop() + country();
						text.setText(all);
						
						System.out.println("Show Pop & Country");	
					}
					//8
					else if (rock.isSelected()== false && randb.isSelected()==true 
							&& country.isSelected()==false
							&& rap.isSelected()==true && pop.isSelected()==false){
						
						String all = rap() + rb();
						text.setText(all);
						
						System.out.println("Show Rap & R&B");	
					}
					//9
					else if (rock.isSelected()== false && randb.isSelected()==false 
							&& country.isSelected()==true
							&& rap.isSelected()==true && pop.isSelected()==false){
						
						String all = rap() + country();
						text.setText(all);
						
						System.out.println("Show Rap & Country");	
					}
					//10
					else if (rock.isSelected()== false && randb.isSelected()==false 
							&& country.isSelected()==false
							&& rap.isSelected()==true && pop.isSelected()==true){
						
						String all = rap() + pop();
						text.setText(all);
						
						System.out.println("Show Rap & Pop");	
					}
					//--------------------4 F's------------------------------
					else if (rock.isSelected()== false && randb.isSelected()==true 
							&& country.isSelected()==false
							&& rap.isSelected()==false && pop.isSelected()==false){
						
						String all = rb();
						text.setText(all);
						
						System.out.println("Show R&B");	
					}
					else if (rock.isSelected()== false && randb.isSelected()==false 
							&& country.isSelected()==true
							&& rap.isSelected()==false && pop.isSelected()==false){
						
						String all = country();
						text.setText(all);
						
						System.out.println("Show Country");	
					}
					else if (rock.isSelected()== false && randb.isSelected()==false 
							&& country.isSelected()==false
							&& rap.isSelected()==false && pop.isSelected()==true){
						
						String all = pop();
						text.setText(all);
						
						System.out.println("Show Pop");	
					}
					else if (rock.isSelected()== false && randb.isSelected()==false 
							&& country.isSelected()==false
							&& rap.isSelected()==true && pop.isSelected()==false){
						
						String all = rap();
						text.setText(all);
						
						System.out.println("Show Rap");	
					}
				}
//-------------------end of the method-------------------------------		
			}
//------------------end of the class-------------------------------
			private class clearListener implements ActionListener {
				
				@Override
				public void actionPerformed(ActionEvent arg0) {
					rap.setSelected(false);
					country.setSelected(false);
					rock.setSelected(false);
					pop.setSelected(false);
					randb.setSelected(false);
					text.setText(null);
					
				}
			}

			// Action listener for components that end the program.
			private class QuitListener implements ActionListener {

				/* 
				 * Terminates the program.
				 */
				@Override
				public void actionPerformed(ActionEvent e) {			
					System.exit(0);			
				}
			}

}	
	


	
